#ifndef _main__h
#define __main_h
//HAL--------------------



//Const--------------------
//base 4ms
#define D_1s         250   //1s
#define D_40ms       10    //40ms
#define D_300ms   50 //300ms
#define D_500ms      125     //500ms
#define D_5s        5
#define D_2s        2
 #define D_1m  60

 
#define  D_keyBaoWenAndKaiGuan  1
#define  D_keyDIY               2
#define  D_keySetWenDuAndShiJian 3
#define  D_keyShi                  4
#define  D_keyFen				5
#define  D_keyYuYue             6
#define  D_keyCaiDan              7
#define  D_keyQueDing            8

#define D_Tang    			  1
#define D_Zhou				2
#define D_JianZha 		 	3
#define D_SuanNai			4	
#define D_YingErShiWu  		5  
#define D_NaiZhou			6
#define D_RouFan 			7
#define D_Pizza				8
#define D_ShuCai			9	
#define D_DunZhu			10	
#define D_ShuCaiJuan		11
#define D_ZaiJiaRe  		12
#define D_YanMaiZhou 		13
#define D_ManZhu			14
#define D_Zheng				15
#define D_RouDong			16
#define D_MianBao			17
#define D_FaMian			18
#define D_YiFen  			19
#define D_GuoJiang 			20
#define D_Kao				21
#define D_Jiu				22
#define D_ReXun				23
#define D_LengXun			24
 
 #define D_DIY              25
 
 
 #define D_flashTemp        1
 #define D_flashTime        0
//Var----------------------
#ifdef  MAIN_C
uint8_t  timer40ms;
uint8_t timer1m;
uint8_t timer300ms;
uint8_t timer1s;
uint8_t  timer500ms;
uint8_t longKeyHoldTime;
uint8_t longKeyValue;
uint8_t holdKey;
uint8_t longKeyJudgeTime;
uint8_t keyValue;
bit bSecFlash500ms;

uint8_t flashShiJianTime;
bit bFunctionSure;
bit bErrorBuzz;
uint8_t function;
uint16_t gongZuoShiJian;
uint8_t flashSetTempTime;
uint8_t setTemp;
bit bYuYue;
uint8_t gongZuoWenDu;
bit bBaoWen;
uint16_t diyTimeArr[3];  
uint8_t  diyTempArr[3];
uint16_t mianBaoTimeArr[2];  
bit bDiy;
uint16_t baoWenTime;
bit bFlash;
bit bLastFlash;
bit bAllowBaoWen;
bit bGongNeng;
uint8_t diyStep;
uint16_t yuYueTime;

bit bAllowGongZuoShiJianDec;
bit bHoldBottomTempTime;
bit bFinishBuzz;
uint8_t finishBuzzNum;
uint8_t step;
uint8_t holdBottomTempTime;
uint8_t workDiyStep;
uint16_t lastGongZuoShiJian;
uint16_t holdGongZuoTime;

	uint8_t		check1;
uint8_t				check2;
uint8_t				check3;
uint8_t				check4;
uint8_t				check5;
uint8_t manDunStep;

bit bCurTemp;
bit bStart;
bit b100;
bit bUpDate;
bit b1s;

#else
	extern bit b1s;

	extern bit bUpDate;
extern bit b100;


extern bit bStart;
extern bit bCurTemp;
extern uint8_t manDunStep;	
extern	uint8_t		check1;
extern uint8_t				check2;
extern uint8_t				check3;
extern uint8_t				check4;
extern uint8_t				check5;
	extern uint16_t lastGongZuoShiJian;
extern uint16_t holdGongZuoTime;
extern uint8_t workDiyStep;
extern bit bAllowGongZuoShiJianDec;
extern bit bHoldBottomTempTime;
extern bit bFinishBuzz;
extern uint8_t finishBuzzNum;
extern uint8_t step;
extern	uint16_t mianBaoTimeArr[2];  
	extern uint16_t yuYueTime;
extern uint8_t diyStep;
extern bit bAllowBaoWen;
extern bit bGongNeng;
extern bit bFlash;
extern bit bLastFlash;
extern uint16_t baoWenTime;
extern bit bDiy;
extern uint16_t diyTimeArr[3];  
extern uint8_t  diyTempArr[3];
// extern	uint8_t diyStep1Temp;
// extern uint16_t diyStep1Time;
// extern uint8_t diyStep2Temp;
// extern uint16_t diyStep2Time;
// extern uint8_t diyStep3Temp;
// extern uint16_t diyStep3Time;
extern bit bBaoWen;
extern uint8_t gongZuoWenDu;
extern uint8_t flashSetTempTime;
extern uint8_t setTemp;
extern bit bYuYue;
extern uint16_t gongZuoShiJian;
extern uint8_t flashShiJianTime;
extern bit bFunctionSure;	
extern uint8_t function;
extern bit bErrorBuzz;
extern	uint8_t timer300ms;
extern bit bSecFlash500ms;
extern uint8_t  timer40ms;
extern uint8_t timer1m;
extern uint8_t timer1s;
extern uint8_t  timer500ms;
extern uint8_t longKeyHoldTime;
extern uint8_t longKeyValue;
extern uint8_t holdKey;
extern uint8_t longKeyJudgeTime;
extern uint8_t keyValue;
#endif


//Function----------------------
void ZhengFunction();
void FanFunction();
void ZhouFunction();
 void  manDunFunction();
   void BaoWen();
void ordFunction(uint8_t gongZuoWenDuTop,uint8_t gongZuoWenDuBottom);
void diyFunction();
void mianBaoFunction();
void functionChoice();
void timerControl();
void PowerOff();
void getKey();
void keyBaoWenAndKaiGuan();
void keyDIY();
void keySetWenDuAndShiJian();
void keyShi();
void keyFen();
void keyYuYue();
void keyQueDing();	
void keyCaiDan();
void  QuFanFlash();
void    JiXuFlash();
#endif